<?php
namespace app\validate;

class MemberValidate extends BaseValidate
{
    protected $rule =   [
        'mobile'            => 'require|mobile',
        'code'              => 'require|number',
        'jscode'            => 'require',
        'openid'            => 'require',
        'nickname'          => 'require',
        'avatar'            => 'require',
        'scene'             => 'require|number',
    ];

    protected $message  =   [
        'mobile.require'                => '手机号不能为空',
        'mobile.mobile'                 => '手机号格式错误',
        'jscode.require'                => '授权码不能为空',
        'openid.require'                => 'openid不能为空',
        'nickname.require'              => '昵称不能为空',
        'avatar.require'                => '头像不能为空',
        'code.require'                  => '验证码不能为空',
        'code.number'                   => '验证码必须是数字',
        'scene.number'                  => '发送场景格式错误',
    ];

    protected $scene = [
        'miniProgramLogin'          =>  ['jscode'],
        'quickLogin'                =>  ['mobile','code'],
        'sendSmsCode'               =>  ['mobile','scene'],
    ];

}